package android.slc.core.vm;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.databinding.Observable;
import androidx.databinding.ObservableBoolean;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;

/**
 * 状态栏代理
 *
 * @author android.slc
 * @date 2021/2/5 14:36
 */
public class BarVm extends AndroidViewModel {
    private final SingleLiveEvent<Boolean> barLightMode = new SingleLiveEvent<>();

    public BarVm(@NonNull Application application) {
        super(application);
    }

    public LiveData<Boolean> getBarLightModeOb() {
        return barLightMode;
    }

    public boolean getBarLightMode() {
        return Boolean.TRUE.equals(barLightMode.getValue());
    }

    /**
     * 同步syncBarStyle
     */
    public void syncBarStyle() {
        barLightMode.call();
    }

    public void setStatusBarLightMode(final boolean isLightMode) {
        barLightMode.setValue(isLightMode);
    }

}
